<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>登录</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="description" content="This is my page">
	
	<!--//webfonts-->
	<script src="<%=basePath%>js/jquery-3.2.1.min.js"></script>
	<style type="text/css">
	  img:hover{  
                transform: scale(1.4);  
            }
       span{cursor:pointer} 
       p{
          width: 150px;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }
        a{
              text-decoration: none;
        }
	</style>
  </head>
      
  <body>
    
  </body>
  <script type="text/javascript">
    var ls=${ls};
    var html='';
    var type='mpg,mpeg,avi,rm,rmvb,mov,wmv,asf,dat(VCD),asx,wvx,mpe,mpa,mp4,mp3';
    for(var i=0;i<ls.length;i++){
      html+='<div style="float:left"><a href="download?id='+ls[i].ID+'"><img id="'+ls[i].ID+'" src="filetransfer/showImge.html?id='+ls[i].ID+'" style="width: 100px;height: 150" ></a>';
      html+='<p title="'+ls[i].filename+'"><a href="filetransfer/toPaly.html?id='+ls[i].ID+'">'+ls[i].filename+'</a></p>';
      html+='<span onclick="del(\''+ls[i].ID+'\')">删除</span></div>';
    }
    $('body').html(html);
    function del(id){
      if(confirm("确定删除该条记录？")){
       console.log(id);
       $.ajax({    
	    url:'filetransfer/del.html',// 跳转到 action  
	    data:{id:id},
	    type:'GET',    
	    success:function(data) {  
	        alert("删除成功！");  
	        location.replace(location)  ;  
	     } ,
	     error: function(){
           alert(arguments[1]);
         } 
	   });  
	  }
    }
  </script>
  
</html>
